using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter11
{
	/// <summary>
	/// Example01: The Vector Product
	/// Two vectors lying in the xy plane are given 
	/// by the equations A = 2i + 3j and B = -i + 2j. 
	/// Find A \times B and verify that A \times B = - B \times A.
	/// </summary>
	public class Example01
	{
		public Example01()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Vector A = new L.Vector();
			A.X = 2.0;
			A.Y = 3.0;
			A.Z = 0.0;

			L.Vector B = new L.Vector();
			B.X = -1.0;
			B.Y = 2.0;
			B.Z = 0.0;

			L.Vector C = A%B;

			result += Convert.ToString(C.X)+"  ";
			result += Convert.ToString(C.Y)+"  ";
			result += Convert.ToString(C.Z)+"  ";

			C = B%A;

			result += Convert.ToString(C.X)+"  ";
			result += Convert.ToString(C.Y)+"  ";
			result += Convert.ToString(C.Z)+"  ";

			L.Vector D = ((2.0*L.UnitVector.i)+(3.0*L.UnitVector.j))%
				((-1.0*L.UnitVector.i)+(2.0*L.UnitVector.j));

			result += Convert.ToString(D.X)+"  ";
			result += Convert.ToString(D.Y)+"  ";
			result += Convert.ToString(D.Z)+"  ";

		}
	}
}
